<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>10题</title>
    <script>
        window.onload = function () {
            let oBbox = document.getElementById("bBox")
            let oBox2 = document.getElementById("box2");
            let oBox1 = document.getElementById("box1");
            oBox1.onclick = function () {
                oBox2.className = "show";
                oBox1.className = "change";
            }
            oBox2.onmouseleave = function () {
                oBox1.className = "displayShow";
                oBox2.className = "none";
            }
        }
    </script>
    <style>
        #bBox {
            width: 200px;
            height: 200px;
            border: 1px solid red;
            display: flex;
        }
        #box1 {
            width: 100px;
            height: 100px;
            background-color: pink;
            border-radius: 50%;
            margin: 50px auto;
            text-align: center;
            line-height: 100px;
        }
        #box2 {
            display: none;
            position: absolute;
            width: 200px;
            height: 200px;
        }
        .box {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
            width: 80px;
            height: 80px;
            background-color: tomato;
            border-radius: 50%;
            text-align: center;
            line-height: 80px;
            transition: 2s;
        }
        #box1.change {
            display: none;
            color: yellow;
        }
        .box {
            width: 80px;
            height: 80px;
            background-color: tomato;
            border-radius: 50%;
            text-align: center;
            line-height: 80px;
        }
        #box2.show {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-content: space-between;
            flex-flow: row wrap;
        }
        .show .box {
            /* position: none; */
            position: relative;
            margin: 0;
            background-color: tomato;
            border-radius: 50%;
            text-align: center;
            line-height: 80px;
            transition: 2s;
        }
        .none {
            display: none;
        }
        .displayShow {
            display: block;
        }
    </style>
</head>

<body>
<div id="bBox">
    <div id="box1">菜单</div>
    <div id="box2">
        <div class="box">首页</div>
        <div class="box">文章</div>
        <div class="box">登录</div>
        <div class="box">注册</div>
    </div>
</div>

</body>
</html>